<?php

/**
 * Description of Users
 *
 * @author Suraj
 */
class Model_Users extends Zend_Db_Table{
    protected $_name="users";

    //show users
    function users() {
        return $this->fetchAll();
    }

    function createUser($newUser) {
        $query=array (
            'Username'=>$newUser['username'],
            'Password'=>$newUser['password'],
            'Role'=>$newUser['role'],
            'Name'=>$newUser['name'],
            'Email'=>$newUser['email']
        );
        return $this->insert($query);
    }

    //update User
    function updateUser($updUser) {
        $query=array (
            'Username'=>$updUser['username'],
            'Password'=>$updUser['password'],
            'Role'=>$updUser['role'],
            'Name'=>$updUser['name'],
            'Email'=>$updUser['email']
        );
        return $this->update($query);
    }

    //delete user
    function deleteUser($id) {
        return $this->delete($id);
    }
}
?>
